<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<script src="/plug-in/layui/layui.js"></script>
<title>合同编号自动生成</title>
<style type="text/css">
.textbox-label { width: 65px; margin-left: 15px;}
</style>
<script>
	var timeNo = null;
	var util = null;
	$(function(){
		layui.use('util', function(){
		  util = layui.util;
		  timeNo = util.toDateString(new Date(), 'yyyy-mmss').substring(2,4);
		});
		
		/*事件响应*/
		$("#buttons .easyui-linkbutton").on("click", function() {
			var motion_code = $(this).attr("motion_code");p.btnOneClick($(this));
			switch (motion_code) {
				case "05":
					break;
				default:
					break;
				}
		});
	});
	/*窗口确认回调方法*/
	function choose(){
		return $('#cNo').textbox('getText');
	}
	
	
	
	function departTypeSelect(newValue,oldValue){
		var v1 = $('#departType').combobox('getValue');
		var v2 = $('#contractType').combobox('getValue');
		var p =  'yyyy-' +  v1+ '-' + v2 + '-mmss';
		if(v1 && v2){
			var no = util.toDateString(new Date(),p).substring(2);
			$('#cNo').textbox('setText',no);
		}
	}
</script>
</head>
<body class="easyui-layout">
	<!-- 但行高度33px，多行时 33乘以行数  -->
	<div data-options="region:'north',split:false,border:false" style="height:33px;">
		<div class="easyui-panel" data-options="fit:true,border:false">
			<!-- 查询条件表单，根据配置进行替换  -->
			<form id="queryForm" >
			 <input type="hidden" name="className" value="com.fs.jzzn.pojo.Project" />
			 
			 <div style="margin-top:5px;margin-left:10px;float:left;">
			  	<select class="easyui-combobox" id="departType" name="departType" style="width:130px;" data-options="label:'所属大区:', onChange:departTypeSelect" 
					url="/console/combobox?valueField=dicValue&textField=dicName&modleName=dictionary&pCode=C1&pCode_searchType=eq" >
			   	</select>
			  	
			  	<select class="easyui-combobox"  id="contractType"  name="contractType" style="width:130px;" data-options="label:'合同类型:' ,onChange:departTypeSelect" 
					url="/console/combobox?valueField=dicValue&textField=dicName&modleName=dictionary&pCode=B6&pCode_searchType=eq" >
			   	</select>
			 </div>
			 
			 <div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" id="cNo" style="width:180px;" data-options="label:'合同编号:',required:false" />
			 </div>
			 <!-- 
			 <div id="buttons" style="margin-top:5px;margin-left:10px;float:left;">
			 	<a href="#" class="easyui-linkbutton" iconCls="icon-reload" motion_code="05" plain="true">换一下</a>
			 </div>
			  -->
			</form>
		</div>
	</div>  
</body>
</html>